﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ETL.Business.Handlers.ProjectTimeHandler;
using ETL.Business.Handlers.SessionHandler;

namespace ETL.Business.Helpers
{
    public class ClockOn
    {
        public ClockOn(){}
        public virtual  void Execute(int category, string activity, string userId, string userName, string reason)
        {
            // set last activity
            (new SetSessionActivity()).Execute(activity);

            // get current project, category and task
            var cSessionDataModel = (new GetSessionDataModel()).Current();

            // clock off
            (new ClockOff()).Execute(userId, userName);

            // create new project time
            (new AddNewProjectTime()).Execute(null, category.ToString(), userName, userId, activity, reason);
        }
    }
}
